import AjaxForBusOpen from '@/utils/AjaxForBusOpen'

// let reqUrl = 'http://47.104.171.141/custom-line-api/'`
// let reqUrl = 'https://www.easy-mock.com/mock/5d63a71ca621ca0594744856/jd-custom-api_copy/custom-line-api/'

// 添加公共参数MERCHANT_NO并处理传入参数为空的情况
function shuttleAjax(url, params) {
  params = params || {}
  return AjaxForBusOpen(url, params)
}

// 获取班线列表
export const getRouteList = params => {
  return shuttleAjax('route/list', params)
}

// 获取班线站点详情
export const getRouteStationName = params => {
  return shuttleAjax('route/stationName', params)
}

// 获取线路下的日期列表
export const getRouteQueryDate = params => {
  return shuttleAjax('route/queryDate', params)
}

// 获取线路下当前时间班次列表
export const getRouteDetail = params => {
  return shuttleAjax('route/detail', params)
}

// 选择完车票点击下一步后锁定座位
export const getRouteLockSeat = params => {
  return shuttleAjax('route/lockSeat', params)
}

// 退出订单页是进行座位解锁
export const getRouteUnlockSeat = params => {
  return shuttleAjax('route/unLockSeat', params)
}

// 订单生成与支付
export const addOrder = params => {
  return shuttleAjax('order/add', params)
}

// 获取我的车票
// export const getTicketList = params => {
//   return shuttleAjax('ticket/list', params)
// }

// 获取车票列表(正常、失效)
export const getTicketList = params => {
  return shuttleAjax('ticket/list', params)
}

// 获取车票详情
export const getTicketDetail = params => {
  return shuttleAjax('ticket/detail', params)
}

// 获取不可用的车票
export const getTicketInvalidList = params => {
  return shuttleAjax('ticket/invalid/list', params)
}

// 退票
export const getTicketRefund = params => {
  return shuttleAjax('order/ticket/refund', params)
}

// 获取订单列表
export const getOrderList = params => {
  return shuttleAjax('order/list', params)
}

// 获取订单详情
export const getOrderDetail = params => {
  return shuttleAjax('order/detail', params)
}

// 星级评分
export const setEvaluate = params => {
  return shuttleAjax('evaluate/add', params)
}
